home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19960209-19960425 / 000238_news@columbia.edu _Tue Mar 19 21:29:37 1996.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: news@columbia.edu
  2. Received: from apakabar.cc.columbia.edu (apakabar.cc.columbia.edu [128.59.35.159]) by watsun.cc.columbia.edu (8.7.3/8.7.3) with ESMTP id VAA19482 for <kermit.misc@watsun>; Tue, 19 Mar 1996 21:29:36 -0500 (EST)
  3. Received: (from news@localhost) by apakabar.cc.columbia.edu (8.7.3/8.7.3) id VAA23502 for kermit.misc@watsun; Tue, 19 Mar 1996 21:29:33 -0500 (EST)
  4. Path: news.columbia.edu!sol.ctr.columbia.edu!news.msfc.nasa.gov!newsfeed.internetmci.com!news.mathworks.com!fu-berlin.de!news.dfn.de!news.dkrz.de!news.rrz.uni-hamburg.de!news.Hanse.DE!mwhh!ranahh.hanse.de!vgrote
  5. From: vgrote@ranahh.hanse.de (Volkmar Grote)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: Re: How to get string with '\' into take script?
  8. Distribution: world
  9. Message-ID: <314efc48.52414e414848@ranahh.hanse.de>
  10. Date: Tue, 19 Mar 1996 19:26:16 +0100
  11. References: <31418faf.52414e414848@ranahh.hanse.de> <4hvpm2$ilp@apakabar.cc.columbia.edu> <314dba9e.52414e414848@ranahh.hanse.de>
  12. Organization: Hanse Networking eV, Hamburg
  13. X-Newsreader: rnr v2.13
  14. X-Posting-Software: UUPC/extended 1.12k inews (11Dec94 12:33)
  15. Lines: 82
  16.  
  17. I wrote:
  18.  
  19. > fdc@watsun.cc.columbia.edu (Frank da Cruz) writes:
  20. >
  21. >> In article <31418faf.52414e414848@ranahh.hanse.de>,
  22. >> Volkmar Grote <vgrote@ranahh.hanse.de> wrote:
  23. >
  24. > [ ... ]
  25. >
  26. >> : Can I prevent Kermit from interpreting the '\'s? Or can I
  27. >> : substitute them on the command line so they come out correctly
  28. >> : in the output commands?
  29. >> : 
  30. >> I think the answer is pretty simple, if not obvious, but I am not
  31. >> certain because I haven't seen your script.
  32. >
  33. > [ ... ]
  34. >
  35. >> Now suppose you want to keep the backslashes (U-umlauts) intact.  We
  36. >> have a function for that, \fcontents():
  37. >>
  38. >>   echo \fcontents(\%a)
  39. >>   a\7b\%c\\d
  40. >>
  41. >> Does this help?
  42. >
  43. > Ten out of ten! I still have to get my checksums right ...
  44.  
  45. ... and the funny difference between "output", "echo" and "write screen"
  46. when it comes to backslashes.
  47.  
  48. Kermit is called as "kermit script = string" with doubled backslashes.
  49.  
  50. The script:
  51. -----------
  52. set take echo off
  53.  
  54. define \%p 3
  55. xif > \v(args) 3 { -
  56.     if EQUAL \&@[2] = -
  57.         assign \%t \&@[\%p], -
  58.         increment \%p,  -
  59.         while < \%p \v(args) { -
  60.             assign \%t \fcontents(\%t) \&@[\%p], -
  61.             increment \%p } -
  62. } -
  63. else { -
  64.     assign \%t Eine unbekannte Stoerung liegt vor, -
  65. }
  66. write screen write screen \fcontents(\%t) \13
  67. echo echo \fcontents(\%t) \13
  68. output output \fcontents(\%t) \13
  69.  
  70. quit
  71. -----------
  72.  
  73. The output:
  74. -----------
  75. output XXXXXXXXXXXX
  76. \-Test R\DELN 1 \ 2 \ 3 \ 4 \ 1 \
  77. <=;
  78.  
  79. write screen XXXXXXXXXXXX
  80. \-Test R\DELN 1 \ 2 \\ 3 \\\ 4 \\\\ 1 \
  81. <=;
  82.  
  83. echo XXXXXXXXXXXX
  84. \-Test R\DELN 1 \ 2 \\ 3 \\\ 4 \\\\ 1 \
  85. <=;
  86.  
  87. -----------
  88.  
  89. Any ideas?
  90.     Volkmar
  91.  
  92. PS: Please respond in email also, as I go on a holiday on Thursday ...
  93. --
  94. vgrote@ranahh.hanse.DE
  95. Volkmar Grote, Gilbertstrasse 25, D-22767 Hamburg, Germany, +49-40-31 33 39
  96.  
  97. "I want to die peacefully in my sleep, just like my grandfather...
  98. Not screaming in terror, like his passengers!" (jbs@asns.tredydev.unisys.com)